package ooday02;

public class AnimalTest {
    public static void main(String[] args) {
        /*
        Dog xh=new Dog("小黑",2,"黑色");
        xh.eat();
        xh.drink();
        xh.home();
        xh.swim();

        Chick hh=new Chick("小花",3,"黄黑");
        hh.eat();
        hh.drink();
        hh.eggs();

        Fish xy=new Fish("金鱼",1,"红色");
        xy.eat();
        xy.drink();
        xy.swim();

         */
        Dog[] dogs=new Dog[3];
        dogs[0]=new Dog("小黑",1,"黑色");
        dogs[1]=new Dog("小白",2,"白色");
        dogs[2]=new Dog("小灰",3,"灰色");
        dogs[0].age=5;
        System.out.println(dogs[0].age);
        dogs[2].eat();
        for(int i=0;i<dogs.length;i++){
            System.out.println(dogs[i].name);
            dogs[i].eat();
        }












    }
}
